<?php

class SiteBaseAction extends BaseAction
{
    protected $siteObj;


    public function __construct()
    {
        parent::__construct();

        $this->access();

        $leftMenus = C('LEFT_MENU_SITE');
        $actionName = $this->getControllerFunction();
        $siteObj = session('site');
        $this->siteObj = $siteObj;

        $alert = parseAlert();

        $this->assign('alert', $alert);

        $this->assign('_actionName', $actionName);
        $this->assign('leftMenus', $leftMenus);
        $this->assign('siteObj', $siteObj);
        C('LAYOUT_NAME','layouts/medium');
    }


    protected function access()
    {
        if (!session('?site')) {
            header("Location:" . $this->baseUrl . "/Medium/Auth/index");
            exit;
        }
    }

}